#./thirdparty/mbedtls/Makefile
SOURCES = $(wildcard library/*.c)
OBJS = $(patsubst %.c,%.o,$(notdir $(SOURCES)))
OBJSD = $(addprefix $(TMP_DIR)mbedtls/,$(OBJS))

INCLUDE = -I $(PWD)/thirdparty/mbedtls/include

all:chkdir mbedtls$(TAGTYPE)

chkdir:
	$(shell mkdir -p $(TMP_DIR)mbedtls/)

mbedtls_static:$(OBJS)
	$(AR) $(OUT_DIR)mbedtls.a $(OBJSD)

mbedtls_shared:$(OBJS)
	$(CC) -shared -fPIC $(OBJSD) -o $(OUT_DIR)mbedtls.so

$(OBJS):%.o:library/%.c
	$(CC) $(INCLUDE) $(CFLAGS) -c $< -o $(TMP_DIR)mbedtls/$@

clean:
	rm -rf $(TMP_DIR)mbedtls/*.o
